import { defineComponent } from 'vue';
import { useModal } from '../../dist';

import TestModal from './components/modal';

export default defineComponent({
  setup() {
    const [closeModal, renderModal] = useModal();
    const openHandler = () => {
      renderModal(<TestModal onCloseModal={closeModal} />);
    };
    return () => (
      <>
        <div>Hello World</div>
        <button type="button" onClick={openHandler}>open modal</button>
      </>
    );
  }
});